Commentaire sur Les Juges 3:2: Rachi, Rambam, Ibn Ezra et plus

רַ֗ק לְמַ֙עַן֙ דַּ֚עַת דֹּר֣וֹת בְּנֵֽי־יִשְׂרָאֵ֔ל לְלַמְּדָ֖ם מִלְחָמָ֑ה רַ֥ק אֲשֶׁר־לְפָנִ֖ים לֹ֥א יְדָעֽוּם׃

surtout pour l’instruction des nouvelles générations d’Israël, afin de les aguerrir aux combats qu’elles ne connaissaient pas encore:

Rashi on Judges

Only so that they should know. For this alone, He permitted these nations to remain, so that future generations of the Bnei Yisroel might grasp the consequence of iniquity—for it was now necessary for them to undergo martial training.

Metzudat David on Judges

ONLY SO THAT THEY SHOULD KNOW: It wants to teach that only because of this they will become aware of the wonders of the miracles that were done for them since then

Rashi on Judges

Whereas earlier when they stood worshiping Adonoy.